﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Exercise10
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int count = 0; // 计数器，记录符合条件的三位数的个数

            for (int i = 1; i <= 4; i++)
            {
                for (int j = 1; j <= 4; j++)
                {
                    for (int k = 1; k <= 4; k++)
                    {
                        if (i != j && i != k && j != k) // 判断三个数字是否互不相同
                        {
                            int number = i * 100 + j * 10 + k; // 组成三位数
                            Console.WriteLine(number);
                            count++;
                        }
                    }
                }
            }

            Console.WriteLine("共有" + count + "个三位数");

            Console.ReadLine();
        }
    }
}
